home *** CD-ROM | disk | FTP | other *** search
/ Shareware Super Platinum 8 / Shareware Super Platinum 8.iso / mac / PROGTOOL / GWMALLOC.ZIP;1 / GWMALLOC.TAR / gw_malloc / chunk.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-04-08  |  2.9 KB  |  104 lines

  1. /*
  2.  * defines for low level memory management routines
  3.  *
  4.  * Copyright 1992 by Gray Watson and the Antaire Corporation
  5.  *
  6.  * This file is part of the malloc-debug package.
  7.  *
  8.  * This library is free software; you can redistribute it and/or
  9.  * modify it under the terms of the GNU Library General Public
  10.  * License as published by the Free Software Foundation; either
  11.  * version 2 of the License, or (at your option) any later version.
  12.  *
  13.  * This library is distributed in the hope that it will be useful,
  14.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  16.  * Library General Public License for more details.
  17.  *
  18.  * You should have received a copy of the GNU Library General Public
  19.  * License along with this library (see COPYING-LIB); if not, write to the
  20.  * Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  21.  *
  22.  * The author of the program may be contacted at gray.watson@antaire.com
  23.  *
  24.  * $Id: chunk.h,v 1.16 1993/04/05 22:29:57 gray Exp $
  25.  */
  26.  
  27. #ifndef __CHUNK_H__
  28. #define __CHUNK_H__
  29.  
  30. #include "malloc.h"            /* for IMPORT ... */
  31.  
  32. /* some argument defines */
  33. #define CHUNK_PNT_ANAL    0        /* anal checking on pointer */
  34. #define CHUNK_PNT_LOOSE    1        /* looser checking */
  35.  
  36. /*<<<<<<<<<<  The below prototypes are auto-generated by fillproto */
  37.  
  38. IMPORT    int        _calloc_count;  /* # callocs, done in alloc */
  39.  
  40. /*
  41.  * startup the low level malloc routines
  42.  */
  43. IMPORT    int    _chunk_startup(void);
  44.  
  45. /*
  46.  * run extensive tests on the entire heap depending on TYPE
  47.  */
  48. IMPORT    int    _chunk_heap_check(void);
  49.  
  50. /*
  51.  * run extensive tests on PNT from FUNC. test PNT HOW_MUCH of MIN_SIZE
  52.  * (or 0 if unknown).  returns [NO]ERROR
  53.  */
  54. IMPORT    int    _chunk_pnt_check(const char * func, char * pnt,
  55.                  const int check, int min_size);
  56.  
  57. /*
  58.  * return some information associated with PNT, returns [NO]ERROR
  59.  */
  60. IMPORT    int    _chunk_read_info(char * pnt, unsigned int * size,
  61.                  char ** file, unsigned int * line);
  62.  
  63. /*
  64.  * get a SIZE chunk of memory for FILE at LINE
  65.  */
  66. IMPORT    char    *_chunk_malloc(const char * file, const unsigned int line,
  67.                    unsigned int size);
  68.  
  69. /*
  70.  * frees PNT from the heap, returns FREE_ERROR or FREE_NOERROR
  71.  */
  72. IMPORT    int    _chunk_free(const char * file, const unsigned int line,
  73.                 char * pnt);
  74.  
  75. /*
  76.  * reallocate a section of memory
  77.  */
  78. IMPORT    char    *_chunk_realloc(const char * file, const unsigned int line,
  79.                 char * oldp, unsigned int new_size);
  80.  
  81. /*
  82.  * log present free and used lists
  83.  */
  84. IMPORT    void    _chunk_list_count(void);
  85.  
  86. /*
  87.  * log statistics on the heap
  88.  */
  89. IMPORT    void    _chunk_stats(void);
  90.  
  91. /*
  92.  * dump the unfreed memory, logs the unfreed information to logger
  93.  */
  94. IMPORT    void    _chunk_dump_not_freed(void);
  95.  
  96. /*
  97.  * log the heap structure plus information on the blocks if necessary
  98.  */
  99. IMPORT    void    _chunk_log_heap_map(void);
  100.  
  101. /*<<<<<<<<<<   This is end of the auto-generated output from fillproto. */
  102.  
  103. #endif /* ! __CHUNK_H__ */
  104.